package com.woniuxy.run.user.exception;

import com.woniuxy.ResponseResult;
import org.springframework.web.bind.annotation.ExceptionHandler;
import org.springframework.web.bind.annotation.RestControllerAdvice;

/**
 * 异常处理
 */
@RestControllerAdvice
public class MyExceptionHandler {

    @ExceptionHandler(AccountExsitException.class)
    public ResponseResult exceptionHandler() {
        return new ResponseResult<>(250,"名称已经存在");
    }

    @ExceptionHandler(IMGTooBigException.class)
    public ResponseResult imgException() {
        return new ResponseResult<>(251,"图片尺寸太大");
    }
}
